cmake_minimum_required(VERSION 3.13.4)

project(intnet)
set(CXX_FLAGS
    -g
    -Wall
    -std=c++11
    -D_PTHREADS
    -Wno-unused-parameter
)

set(CMAKE_CXX_COMPILER "g++")
set(CMAKE_CXX_FLAGS_DEBUG "-O0")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CXX_FLAGS}")
string(TOUPPER ${CMAKE_BUILD_TYPE} BUILD_TYPE)
message(STATUS "CXX_FLAGS = " ${CMAKE_CXX_FLAGS} " " ${CMAKE_CXX_FLAGS_${BUILD_TYPE}})

set(SRCS
    channel.cpp
    epoll.cpp
    eventloop.cpp
    httpdata.cpp
    main.cpp
    server.cpp
    until.cpp
    write.cpp
    read.cpp
    mimetype.cpp
)




add_executable(intnet ${SRCS})
target_link_libraries(intnet
    timer
    lock
    thread
)

add_subdirectory(timer)
add_subdirectory(lock)
add_subdirectory(thread)

